<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<title><?php echo $view_title?></title>
	<link rel=stylesheet href='./template/<?php echo $OJ_TEMPLATE?>/<?php echo isset($OJ_CSS)?$OJ_CSS:"hoj.css" ?>' type='text/css'>
</head>
<body>
<div id="wrapper">
	<?php require_once("oj-header.php");?>

	
<center>
	<?php
	if($view_content)
	echo "<center>
	<table>
			<tr>
				<td class=blue>$to_user:".htmlspecialchars(str_replace("\n\r","\n",$view_title))." </td>
			</tr>
			<tr><td><pre>". htmlspecialchars(str_replace("\n\r","\n",$view_content))."</pre>		
				</td></tr>
    </table></center>";
	
	?>
<form role="form" class="form-horizontal" method="post" action="mail.php">
<!-- Modal -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
        <h4 class="modal-title" id="myModalLabel">发邮件</h4>
      </div>
      <div class="modal-body">


            <div class="form-group">

                <div class="col-sm-11">
                    <input class="form-control" type="text" name="to_user" placeholder="请输入收件人ID"/>
                </div>
            </div>
            <div class="form-group">
                
                <div class="col-sm-11">
                    <input class="form-control" type="text" name="title" placeholder="请输入标题"/>
                </div>
            </div>
            <div class="form-group">

                <div class="col-sm-11">
                    <textarea class="form-control" name="content" rows="8" placeholder="请输入邮件正文"></textarea>
                </div>
            </div>


      </div>
      <div class="modal-footer">
                    <button class="form-control btn-primary" type="submit">发送</button>
      </div>
    </div><!-- /.modal-content -->
  </div><!-- /.modal-dialog -->
</div><!-- /.modal -->
</form>
	
<div class="container">
<div class="row">
<div class="col-md-2 sidebar">
   <ul class="nav nav-pills nav-stacked">
      <li class="active"><button class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModal">发邮件</button></li>
   </ul>
</div>


	
   
   
<div class="col-md-10">
   <table class="table table-striped">
   <thead><tr><th>发件方ID</th><th>标题</th><th>日期</th></tr></thead>
   <tbody>
			<?php 
			$cnt=0;
			foreach($view_mail as $row){
				if ($cnt) 
					echo "<tr class='oddrow'>";
				else
					echo "<tr class='evenrow'>";
				foreach($row as $table_cell){
					echo "<th>";
					echo "\t".$table_cell;
					echo "</th>";
				}
				
				echo "</tr>";
				
				$cnt=1-$cnt;
			}
			?>
			</tbody>
	</table>
</div>
</center> 
</div>
</div>
	 
<div id=foot>
	<?php require_once("oj-footer.php");?>

</div><!--end foot-->
</div><!--end main-->
</div><!--end wrapper-->
</body>
<script src="http://cdn.bootcss.com/jquery/1.10.2/jquery.min.js"></script>
<script src="http://cdn.bootcss.com/twitter-bootstrap/3.0.3/js/bootstrap.min.js"></script>
</html>
